/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.web.controller;

import com.intelligent.ispc.common.web.Servlets;
import com.intelligent.ispc.core.dto.DUTAttributeDto;
import com.intelligent.ispc.core.dto.TestDataExDto;
import com.intelligent.ispc.core.dto.TestItemDto;
import com.intelligent.ispc.core.dto.YieldDto;
import com.intelligent.ispc.core.service.ReportService;
import com.intelligent.ispc.utils.SystemConfig;
import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.ServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Peter.Li on 2015/10/10.
 */

@Controller
@RequestMapping(value = "/analysis")
public class ReportAnalysisController {

    @Autowired
    private SystemConfig systemConfig;

    @RequestMapping(value = "report", method = RequestMethod.GET)
    public String navSpc(Model model, ServletRequest request) {
        Subject subject = SecurityUtils.getSubject();
        if (!subject.isPermitted("analysis:spc:view")) {
            return "error/noPermission";
        }

        return "analysis/report/reportAnalysis";
    }

}

